<div id="content_header">
  <h3>Scheduling a new Placement Test</h3>
</div>
<!-- FORM SEARCH STUDENTS -->
<div class="row" ng-hide="ptNew.Student.Id">
  <form role="form" ng-submit="searchStudent()">
    <div class="form-group">
      <div class="input-group">
        <input type="text" class="form-control" id="" placeholder="Input Student ID or Student Name and press enter to search" ng-model="searchText">
        <span class="input-group-btn">
          <button type="submit" class="btn btn-primary"><i class="simple-icon-magnifier"></i> Search</button>
        </span>
      </div>
    </div>
  </form>
</div>

<!-- RESULTS BY SEARCHING STUDENT NAME / SID  -->
<div class="row" ng-if="students.length > 0" ng-hide="ptNew.Student.Id">
  <table class="table table-hover">
    <thead>
      <tr>
        <th>Name</th>
        <th>SID</th>
        <th>Latest PT</th>
        <th>Latest Course Taken</th>
      </tr>
    </thead>
    <tbody>
      <tr dir-paginate="student in students | itemsPerPage: pagesize" total-items="totalItems">
        <td>
          <span class="dropdown">
            <a href class="dropdown-toggle">
              {{ student.FullName }}
            </a>
            <ul class="dropdown-menu">
              <!-- <li role="presentation" class="dropdown-header">Action</li> -->
              <li ng-if="!student.PlacementTest"><a href ng-click="selectStudent(student.Id)">Register to PT</a></li>
              <li ng-if="!student.Enrollment"><a href ui-sref="sr.new({ id:student.Id })">Register to Course</a></li>
              <li ng-if="!student.PlacementTest"><a href ng-really-message="Are you sure?" ng-really-click="delete(placement_tests, student.PlacementTest.Id)">Delete Placement Test</a></li>
              <li ng-if="student.PlacementTest"><a href ui-sref="pt.edit({ id:student.PlacementTest.Id })">Edit Placement Test</a></li>
            </ul>
          </span>
        </td>
        <td ng-bind-html="student.SID | makeBold:searchKey"></td>
        <td>
          <span ng-if="!student.PlacementTest"><a href ng-click="selectStudent(student.Id)">No Valid PT, Register to PT</a></span>
          <span ng-if="student.PlacementTest">Valid</span>
          <!-- <span ng-if="!student.PlacementTest"></span> -->
        </td>
        <td>Intermediate III, Best Student</td>
      </tr>
    </tbody>
  </table>
  <dir-pagination-controls on-page-change="pageChanged(newPageNumber)" template-url="views/templates/dirPagination.tpl.html"></dir-pagination-controls>
</div>

<!-- PT FORM INPUT -->
<div class="row">
  <form ng-show="ptNew.Student.Id" name="ptForm" role="form" ng-submit="addPT()">

    <div class="form-group">
      <label for="">Student</label>
      <span class="form-control">{{ currStudent.FullName }} <small><a href="" ng-click="resetStudent()">Change Student</a></small></span>
    </div>

    <!-- <div class="form-group">
      <label for="class">* Classroom</label>
      <select name="class" id="class" class="form-control" ng-options="class.Id as class.Name for class in classrooms" ng-model="ptNew.Classroom.Id" required>
        <option value="" ng-hide="ptNew.Classroom.Id">Please Select a Classroom</option>
      </select>
    </div> -->

    <div class="form-group" ng-click="openDatepicker($event, 0)">
      <label for="">Date</label>
      <div class="input-group">
        <input type="hidden" class="form-control" datepicker-popup="{{format}}" ng-model="timepicker.timeA" is-open="datePicker.isOpen[0]" min-date="initDate" datepicker-options="dateOptions" ng-required="true" close-text="Close" ng-disabled="true" />
        <span class="form-control">{{ timepicker.timeA | date: 'dd MMMM yyyy' }}</span>
        <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
      </div>
    </div>

    <div class="form-group">
      <label for="">Time</label>
      <timepicker ng-model="timepicker.timeA" hour-step="timepicker.hstep" minute-step="timepicker.mstep" show-meridian="timepicker.isMeridian"></timepicker>
    </div>

    <button type="submit" class="btn btn-primary" >Submit</button>
  </form>
</div>